insheet using "C:\japan2.csv", clear

generate group=0
replace group=1 if group2==1
sort group

**variable construction (group1=1:control, group2=1:treatment)
label variable group "Japan-ROK Air Movie" 

//socioeconomic
gen male = q1 
label variable male "Male"
gen college = 0 
replace college=1 if q3==4 
label variable college "College Education"

//political opinion
gen pol_interest = 0
replace pol_interest=1 if q5==4 
replace pol_interest=1 if q5==3 
label variable pol_interest "High Political Interest"
gen pol_right = q8
label variable pol_right "Politically Right"

//key question
label variable q10_1 "Stronger Claim Takeshima"
label variable q10_2 "More Economic Cooperation"
label variable q10_3 "More Security Cooperation"
label variable q10_4 "Case by Case Cooperation"
label variable q10_5 "More Envi. Protection Cooperation"
label variable q10_6 "More Disaster Prevention Cooperation"

label variable q11_1 "More Compaies from ROK"
recode q11_1 (1=5)(2=4)(3=3)(4=2)(5=1)
label variable q11_2 "More Students from ROK"
recode q11_2 (1=5)(2=4)(3=3)(4=2)(5=1)
label variable q11_3 "Turn into ROK on Takeshima"
recode q11_3 (1=5)(2=4)(3=3)(4=2)(5=1)
label variable q11_4 "Takeshima issue should be settled by ICJ"
recode q11_4 (1=5)(2=4)(3=3)(4=2)(5=1)
label variable q11_5 "Power Parity with ROK"
recode q11_5 (1=5)(2=4)(3=3)(4=2)(5=1)
label variable q11_6 "Turn into ROK on Confort Women"
recode q11_6 (1=5)(2=4)(3=3)(4=2)(5=1)

label variable q18_1 "JSDF with US Should Help ROK"
recode q18_1 (1=5)(2=4)(3=3)(4=2)(5=1)
label variable q18_2 "JSDF Should Not Help ROK"
recode q18_2 (1=5)(2=4)(3=3)(4=2)(5=1)
label variable q18_3 "JSDF Should Do Back Theater Support for ROK"
recode q18_3 (1=5)(2=4)(3=3)(4=2)(5=1)
label variable q18_4 "Japan Should only Devote to its Defense"
recode q18_4 (1=5)(2=4)(3=3)(4=2)(5=1)
label variable q18_5 "Japan Should Share Military Info. with ROK"
recode q18_5 (1=5)(2=4)(3=3)(4=2)(5=1)


* Hypothesis test of H1
sort group
by group: sum q13_3
by group: sum q14_3

* Hypothesis test of H2/3

sort group

ttest q10_1, by(group) w
ttest q10_2, by(group) w
ttest q10_3, by(group) w
ttest q10_4, by(group) w
ttest q10_5, by(group) w
ttest q10_6, by(group) w

ttest q11_1, by(group) w
ttest q11_2, by(group) w
ttest q11_3, by(group) w
ttest q11_4, by(group) w
ttest q11_5, by(group) w
ttest q11_6, by(group) w


ttest q13_2, by(group) w
ttest q13_1, by(group) w
ttest q13_3, by(group) w
ttest q13_4, by(group) w

ttest q14_2, by(group) w
ttest q14_1, by(group) w
ttest q14_3, by(group) w
ttest q14_4, by(group) w

ttest q18_1, by(group) w
ttest q18_2, by(group) w
ttest q18_3, by(group) w
ttest q18_4, by(group) w
ttest q18_5, by(group) w

ttest q19_1, by(group) w
ttest q19_2, by(group) w

**calculation for MC
tab q10_1 group, col
tab q10_2 group, col
tab q10_3 group, col
tab q10_4 group, col
tab q10_5 group, col
tab q10_6 group, col
tab q18_1 group, col
tab q18_2 group, col
tab q18_3 group, col
tab q18_4 group, col
tab q18_5 group, col

**analysis using regression models
cor group male college pol_interest pol_right
sum group male college pol_interest pol_right
reg q10_3 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie01j.pdf, replace
reg q10_2 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie02j.pdf, replace
reg q10_4 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie03j.pdf, replace
reg q10_5 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie04j.pdf, replace
reg q10_6 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie05j.pdf, replace
reg q18_3 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("Japan Should only Devote to its Defense") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie06j.pdf, replace
reg q18_1 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("JSDF with US Should Help ROK") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie07j.pdf, replace
reg q10_1 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("Stronger Claim Takeshima") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie08j.pdf, replace


**generate additional variables and additional regression on sub-groups (left, right, gender, partyID)
generate left=0
generate right=0
replace left=1 if q8<4
replace right=1 if q8>6
gen Abe_support = 0
replace Abe_support=1 if q6==3
replace Abe_support=1 if q6==4
label variable Abe_support "Support Abe"
gen LDP_support = q7
replace LDP_support = 0 if q7>1
label variable LDP_support "Support LDP"
label variable left "Left"
label variable right "Right"
label variable Abe_support "Park Supporters"
label variable Abe_support "Anti-Park Supporters"
reg q10_3 group##left male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie30j.pdf, replace
reg q10_3 group##right male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie31j.pdf, replace
reg q10_3 group##male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie32j.pdf, replace
reg q10_3 group##Abe_support male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie33j.pdf, replace
reg q10_3 group##LDP_support male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie34j.pdf, replace

reg q10_2 group##left male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie30ej.pdf, replace
reg q10_2 group##right male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie31ej.pdf, replace
reg q10_2 group##male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie32ej.pdf, replace
reg q10_2 group##Abe_support male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie33ej.pdf, replace
reg q10_2 group##LDP_support male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Moviee34ej.pdf, replace

reg q10_4 group##left male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie30cbcj.pdf, replace
reg q10_4 group##right male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie31cbcj.pdf, replace
reg q10_4 group##male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie32cbcj.pdf, replace
reg q10_4 group##Abe_support male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie33cbcj.pdf, replace
reg q10_4 group##LDP_support male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Moviee34cbcj.pdf, replace

reg q10_5 group##left male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie30epj.pdf, replace
reg q10_5 group##right male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie31epj.pdf, replace
reg q10_5 group##male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie32epj.pdf, replace
reg q10_5 group##Abe_support male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie33epj.pdf, replace
reg q10_5 group##LDP_support male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Moviee34epj.pdf, replace

reg q10_6 group##left male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie30dpj.pdf, replace
reg q10_6 group##right male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie31dpj.pdf, replace
reg q10_6 group##male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie32dpj.pdf, replace
reg q10_6 group##Abe_support male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie33dpj.pdf, replace
reg q10_6 group##LDP_support male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Moviee34cbcj.pdf, replace


**attentive audience only**
drop if q9_us ==.
drop if q9_au ==. & group==0
drop if q9_j ==. & group==1
reg q10_3 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie40j.pdf, replace
reg q10_3 group##left male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie41j.pdf, replace
reg q10_3 group##right male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie42j.pdf, replace
reg q10_3 group##male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie43j.pdf, replace
reg q10_3 group##Abe_support male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie44j.pdf, replace
reg q10_3 group##LDP_support male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie45j.pdf, replace

reg q10_2 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie40ej.pdf, replace
reg q10_2 group##left male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie41ej.pdf, replace
reg q10_2 group##right male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie42ej.pdf, replace
reg q10_2 group##male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie43ej.pdf, replace
reg q10_2 group##Abe_support male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie44ej.pdf, replace
reg q10_2 group##LDP_support male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Moviee45ej.pdf, replace

reg q10_4 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie40cbcj.pdf, replace
reg q10_4 group##left male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie41cbcj.pdf, replace
reg q10_4 group##right male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie42cbcj.pdf, replace
reg q10_4 group##male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie43cbcj.pdf, replace
reg q10_4 group##Abe_support male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie44cbcj.pdf, replace
reg q10_4 group##LDP_support male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Moviee45cbcj.pdf, replace

reg q10_5 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie40epj.pdf, replace
reg q10_5 group##left male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie41epj.pdf, replace
reg q10_5 group##right male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie42epj.pdf, replace
reg q10_5 group##male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie43epj.pdf, replace
reg q10_5 group##Abe_support male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie44epj.pdf, replace
reg q10_5 group##LDP_support male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Moviee45epj.pdf, replace

reg q10_6 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie40dpj.pdf, replace
reg q10_6 group##left male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie41dpj.pdf, replace
reg q10_6 group##right male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie42dpj.pdf, replace
reg q10_6 group##male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie43dpj.pdf, replace
reg q10_6 group##Abe_support male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie44dpj.pdf, replace
reg q10_6 group##LDP_support male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Moviee45cbcj.pdf, replace

**analysis (agree=5; disagree=1)
sum q2_1 male college pol_interest Abe_support LDP_support if group==1
sum q2_1 male college pol_interest Abe_support LDP_support if group==0

